<!doctype html>
<html>
<head>
<meta charset="utf-8">
	<meta name="viewport" content="width-device-width, initial-scale=1.0" />
<link rel="stylesheet" href="https://cdn.bootcss.com/font-awesome/5.11.2/css/all.css" />
<link rel="stylesheet" href="css/person_update.css" />
<link rel="shortcut icon" href="ico/logo.ico"/>
<title>无标题文档</title>
</head>

<body>
	<!-- 定义头部区域，放导航和logo -->
	<?php  
	include 'action/session_check.php';//登录判断
	   require_once("conn/conn_db.php");
       $sql = "select * from  user_info where u_name ='".$_SESSION[user]."'"; //查询语句
  $result = $conn->query($sql);                 //执行SQL语句
  //遍历查询结果的每一行
  if ($result->num_rows > 0) {
      while($row = $result->fetch_array()){	
	?>
<header>
<div class="logo"><img src="ico/logo.png" alt=""/>伴美科技</div>
<nav>
<a href="javascript:history.back(-1);" target="_self">返回<<<<</a>
<img src='../<?php echo $row['u_header'];?>' style="border-radius: 50%; width: 36px; height: 36px; position: absolute; top: 20px; right: 38px;" alt="User">
<?php 
}
 } 
?>
</nav>
	</header>
	
<!-- 头部导航结束 -->
	
	<div class="container_box">
	 <table cellspacing="5px">
		 <tr>
			 <td align="center" colspan="2" width="800px"><h2 style="margin-top: 0px; margin-bottom: 30px;">订单信息</h2></td>
		 </tr>
   <?php   
  require_once("conn/conn_db.php");  //包含数据库连接文件 
  if($_GET['O_Num']!= "")
  {
 	$onum = $_GET['O_Num'];  //获取传递的订单编号
 	$sql = "select * from  Order_Info where M_Name='$membername' and O_Num='$onum' order by O_CreateTime desc" ;
 	$result = $conn->query($sql); //执行SQL语句
 	$row = $result->fetch_array();  //获取查询结果
 ?>
  <tr><td width="auto">订单编号</td> <td><h5> <?php echo $row["O_Num"];?></h5>  </td></tr>
		 <tr><td width="350px">商品数量</td> <td> <h5> <?php echo $row["P_Nums"];?> </h5> </td></tr>
		 <tr><td width="350px">订单金额</td> <td> <h4>￥<?php echo $row["O_Money"];?> </h4></td></tr>
		 <tr><td width="350px">收货人</td>   <td> <h5> <?php echo $row["O_Taker"];?> </h5></td></tr>
		 <tr><td width="350px">收货地址</td> <td> <h5> <?php echo $row["O_Address"];?> </h5></td></tr>
		 <tr><td width="350px">联系电话</td> <td> <h5> <?php echo $row["O_Tel"];?>    </h5> </td></tr>
		 <tr><td width="350px">备注</td>     <td> <h5> <?php echo $row["O_Remark"];?>  </h5></td></tr>
		 <tr><td width="350px">订单日期</td> <td> <h5> <?php echo $row["O_CreateTime"];?> </h5></td></tr>
  <tr><td width="auto">状态</td>     <td> <h5> <?php switch ($row["O_Status"])
            {
     	      case '0':
     		       echo '<font color=red>待发货</font>';
     		       break;
     	      case '1':
     		       echo '<font color=blue>已发货</font>';
     		       break;
     	      case '2':
     		       echo '<font color=orange>已结算</font>';
     		       break;
            }
	  ?> </h5> </td></tr>
 </table>
 <table cellspacing="5px">
	 <tr><td  width="800px" colspan="7">商品详情</td></tr>
<tr>
<td align="right" width="150px">商品编号</td><td align="center">商品名称</td><td align="center">商品图片</td><td align="center">单价</td><td align="center">数量</td><td align="center">折扣</td><td align="left" width="150px">小计价格</td></tr>
 <?php
  $sql2 = "select op.*,p.p_name,p.p_image,p.p_id from  Order_Product op, Product_Info p  where op.p_id = p.p_id and O_Num='$onum' order by OP_ID"; 
  $result2 = $conn->query($sql2);              //执行SQL语句
 while($row2 = $result2->fetch_array()) //遍历查询结果的每一行
 {
?>
  <tr>
    <td align="right"> <?php echo $row2["p_id"];?>  </td>
    <td align="center"> <?php echo $row2["p_name"];?></td>
    <td align="center"> <img src='<?php echo $row2["p_image"];?>' width="100px" height="100px"/>  </td>
    <td align="center"> <?php echo $row2["P_UnitPrice"];?>  </td>   
    <td align="center"> <?php echo $row2["P_Nums"];?></td>
    <td align="center"> <?php echo $row2["P_Flod"];?></td>
    <td align="left">￥<?php echo $row2["P_Price"];?></td>
  </tr>
<?php
  }  
 }
?>
</table>
	</div>
	
	
	<!-- 底部模块开始 -->	
	<footer>
    <div class="footer-menus">
	   <div class="contact-us">
		    <p class="menu-title">联系我们</p>
		    <p>地址：中国重庆市XX路XX商务中心XX楼</p>
		   　<p>电话：+86XXX XXXX XXXX</p>
		   　<p>传真：+86XXX　XXXX XXXX</p>
		  　 <p>电子邮箱：admin@163.com</p>
	   </div>
		<div class="service-menu footer-menu">
		  <p class="menu-title">服务概况</p>
		  <ul class="menu-items">
		     <li><a href="#">跨境电商</a></li>
			 <li><a href="#">供应商</a></li>
			 <li><a href="#">移动应用</a></li>
			 <li><a href="#">网页设计</a></li>
		  </ul>
		</div>
		<div class="service-menu footer-menu">
		  <p class="menu-title">跨境产品</p>
		  <ul class="menu-items">
		     <li><a href="#">美妆护肤</a></li>
			 <li><a href="#">家用电器</a></li>
			 <li><a href="#">健康零食</a></li>
			 <li><a href="#">生活用品</a></li>
		  </ul>
		</div>
		<div class="service-menu footer-menu">
		  <p class="menu-title">公司动态</p>
		  <ul class="menu-items">
		     <li><a href="#">信息公开</a></li>
			 <li><a href="#">最近新闻</a></li>
			 <li><a href="#">最新消息</a></li>
			 
		  </ul>
		</div>
		<div class="service-menu footer-menu">
		  <p class="menu-title">帮助与支持</p>
		  <ul class="menu-items">
		     <li><a href="#">帮助中心</a></li>
			 <li><a href="#">联系客服</a></li>
			 <li><a href="#">文档资源</a></li>
			
		  </ul>
		</div>
		<p class="icp-info">备案号信息</p>
		<p class="rights">
		      &copy;2022 伴美科技 - 有限责任公司官网 版权所有
		</p>
		

	</div>	
</footer>
<!-- 底部模块结束 -->		
</body>
</html>